
<h1 class="right">ادارة الأثاث </h1><!--<div class="h1-dot"></div>--><a href="#add_client" class="add_furnitures_pop">
  <img src="images/add-icon.png" align="left" class="left" alt=""/>
</a>
<div id="add_client" class="zoom-anim-dialog mfp-hide">
	<?php require("Furnitures/create.php"); ?>
</div>
<span class="left grey medium margin-left11 margin-top5"><?php echo date('g:ia d/m/Y')?></span>
<div class="clear"></div>
<div id="dashboard-container">
<div class="customers-filter">
    	<table class="furnitures-filter">
        <tr>
          <form name="searchClient" action="actions.php" method="get" id="searchClient">
              <td style="width:50px;">الوحدة :  </td>
              <td>
				<form name="apartment_search" action="#" method="GET" id="apartment_select">
          <select name="apart_id" class="small-select fur_filter" >
                    
                    <?php 
                      if(isset($binds['id']) && $binds['id'] == -1)
                        echo "<option selected = 'selected' value='-1'>الجميع</option>";
                      else
                        echo "<option value='-1'>الجميع</option>";
                        
                      $aprtes = query("SELECT id,apart_name FROM apartments WHERE owner_id = ?",$_SESSION['user_id']);
                      foreach($aprtes as $aprt)
                      {
                        if(isset($binds['id']) && $binds['id'] == $aprt['id'] )
                          echo "<option selected='selected' value='{$aprt['id']}'>{$aprt['apart_name']}</option>";
                        else
                          echo "<option  value='{$aprt['id']}'>{$aprt['apart_name']}</option>";
                        
                      }
                    ?>
          </select>	
				</form>				  
				 </td>
              <td style="width:350px;"></td>
              <td style="width:90px;"><a href="#"><div class="search-botton">تصدير الجميع</div></a></td>
              <td style="width:90px;"><a href="#"><div class="export-button">تصدير</div></a></td>
              <input name="filter" class="client-id" type="hidden" value="2"/>
            </tr>
          </form>
      </table>
    </div>
	<div class="dashboard-row">
    
    	<table class="customers-table">
        	<tr class="customers-table-head">
            	<td width="160px">الاسم</td>
                <td width="140px">السعر</td>
                <td width="100px">الحالة</td>
                <td width="110px">بلد المنشأ</td>
                <td width="100px">العمليات</td>
            </tr>
            <?php if(!empty($furnitures)){
              $j=0;
            foreach($furnitures as $furniture){
			?>
                <tr class="page1 cell-parent">
                    <td ><?php echo  $furns_name[$furniture['furniture']];?></td>
                    <td ><?php echo $furniture['price']; ?></td>
                    <td ><?php echo $furn_status[$furniture['fur_status']];?></td>
                    <td ><?php echo $furniture['source']; ?></td>
                    <td class="white-bg">
                      <a href="#view_client<?php echo $j;?>" class="view_furnitures_pop"><img src="images/view.png" class="" align="" alt="View"/></a>
					 
                      <!--  View Pop-up  -->
                      <div id="view_client<?php echo $j;?>" class="view_client zoom-anim-dialog mfp-hide">
                        <?php require("Furnitures/view.php"); ?>       
                      </div>
                      
                      <a href="#edit_client<?php echo $j;?>" class="edit_furnitures_pop"><img src="images/edit.png" class="margin-right5" align="" alt="Edit"/></a>
                      
                      <!--  Edit Pop-up  -->
                      <div id="edit_client<?php echo $j;?>" class="edit_client zoom-anim-dialog mfp-hide">
                       		<?php require("Furnitures/edit.php"); ?>
                      </div>
                      
                        <a href="#" class="delete"><img src="images/x.png" class="margin-right5" align="" alt="Delete"/></a>
                        <input class="delete-id" type="hidden" value="<?php echo $furniture['furnitures_id'] ?>"/>
                        <input class="filter-id" type="hidden" value="3"/> <!-- 3 means delete furniture -->
                    </td>
                </tr>
				<?php 
          $j++;
        } 
				}else{
				 echo "<td colspan='7' class='large red' align=''>لا توجد نتائج</td>";
				 }
				?>
                </table>
				
				
    </div> 
    <?php
          $start = $page * 20 -19;
          $end  = $start + 19;
          if($end > $totalPages)
            $end = $totalPages
          
        ?>
          <?php if(!empty($furnitures)) { ?>
        <div class="clear"></div>   
        <div class="relative">
        <div id="fur-selection" class="center"></div>
        <span class="middle xsmall showing-results absolute">عرض النتائج <?php echo $start; ?> - <?php echo $end; ?> من إجمالى <?php echo $totalPages; ?></span>
        </div>
        <div class="hidden totalPages"><?php if(isset($totalPages)) {echo $totalPages;} ?></div>
        <div class="hidden currentPage"><?php if(isset($page)) {echo $page;} ?></div>
        <?php } ?>
         <div class="clear"></div>                    
</div>
<br />